package com.manbearpig.todue;

import java.util.ArrayList;
import java.util.List;

import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapController;
import com.google.android.maps.MapView;
import com.google.android.maps.Overlay;
import com.google.android.maps.OverlayItem;

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.media.AudioManager;
import android.media.SoundPool;
import android.media.SoundPool.OnLoadCompleteListener;
import android.os.Bundle;
import android.os.Vibrator;
import android.util.Log;
import android.widget.Toast;

/**
  * @author Aashish Patel
  * @author Andre Giron
  */



public class CrimeAware extends MapActivity {
	private MapView mapView;
	private MapController mapController;
	private ArrayList<OverlayItem> mOverlays = new ArrayList<OverlayItem>();
	private List<Overlay> mapOverlays;
	private Drawable drawable;
	private Context context;
	
    private LocationManager locationManager;
    private LocationListener locationListener;
    
    
	private static final int POINT_RADIUS = 30;
	private static final long PROX_ALERT_EXPIRATION = -1;
	private static LocationManager mlocManager;
	private SoundPool soundPool;
	private int soundID;
	private boolean loaded = false;
	private ArrayList<Zone> zonesList = new ArrayList<Zone>();
	private long[] dangerPattern = {0,300,300,300,300,300};
    private Vibrator v;
    
    
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        mapView = (MapView) findViewById(R.id.mapview);
        mapView.setBuiltInZoomControls(true);
        mapController = mapView.getController();
        mapController.setZoom(18); //18
        mapController.setCenter(new GeoPoint(33000000, -84000000));
        mapOverlays = mapView.getOverlays();
        
       
        /*
        locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);
        locationListener = new LocationListener() {
            public void onLocationChanged(Location location) {                
            	GeoPoint initGeoPoint = new GeoPoint(
                	   (int)(location.getLatitude()*1000000),
                       (int)(location.getLongitude()*1000000));
                mapController.setCenter(initGeoPoint);
            	mapView.invalidate();
            	
                String text = "Latitude: " + location.getLatitude() +  "Longitude: " + location.getLongitude();
                Toast.makeText( getApplicationContext(),text,Toast.LENGTH_SHORT).show();

            	
            }
            public void onStatusChanged(String provider, int status, Bundle extras) {}
            public void onProviderEnabled(String provider) {}
            public void onProviderDisabled(String provider) {}
          };
          
          */
        
        /*
  		GeoPoint a = new GeoPoint(33777026, -84389770); // must multiply your value by 1000000
  		GeoPoint b = new GeoPoint(33777027, -84389754); // must multiply your value by 1000000
`		*/

  		    
  		/*
        zonesList.add(new Zone(33.7770267, -84.3897704, "Bench 1"));
        zonesList.add(new Zone(33.777027,-84.3897549, "Bench 2"));
  		*/
        
  		
       // locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListener);  
        

    }
    
   
    
    
	@Override
	protected boolean isRouteDisplayed() {
		return false;
	}
	
   
}